﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Library;

namespace OA.Cms
{
    public partial class CmsManage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.Bind();
            }
        }

        public void Bind()
        {
            String sql = "select * from Cms_Contents order by DispOrder asc";
            DataTable dt = DataAccess.getDataTable(sql);
            GridView1.DataKeyNames = new String[] { "ContentId" };
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            Bind();
        }

       
        //新增
        protected void BtnAdd_Click(object sender, EventArgs e)
        {
            Response.Redirect("ContentForm.aspx");
        }

        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            
        }

        //查询
        protected void BtnSearcn_Click(object sender, EventArgs e)
        {

        }

    }
}
